package com.example.demo.service;

import com.example.demo.dao.BookDao;
import com.example.demo.modal.BookInfo;

import java.util.ArrayList;
import java.util.List;

public class BookService {
    public List<BookInfo> getList() {
        BookDao bookDao = new BookDao();
        List<BookInfo> bookInfos = bookDao.mockData();
        for (BookInfo bookInfo : bookInfos) {
            if (bookInfo.getStatus() == 1) {
                bookInfo.setStatusCN("已借阅");
            } else {
                bookInfo.setStatusCN("未借阅");
            }
        }
        return bookInfos;
    }
}
